/**
 * @fileOverview Index 业务处理模块
 * @author houjk
 */

import { resolve } from "url";

/**
 * IndexModel类，提供index模板数据
 * @class
 */
class IndexModel {
  /**
   * @constructor
   * @param {string} app koa2的上下文环境
   */
  constructor(app){}

  /**
   * 获取数据
   * @returns {Promise} 异步返回页面模板数据
   * @example
   * let indexModel = new IndexModel;
   * let ret = indexModel.getData();
   */
  getData() {
    return new Promise((resolve,reject)=>{
      setTimeout(() => {
        const indexData = {
          name: 'first swig page',
          version:'1.0.0.1',
          user: {
            name: 'fundon',
            email: 'cfddream@gmail.com'
          }
        };
        resolve(indexData);
      }, 1000);
    })
  }
}
export default IndexModel;